<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>积分商城</title>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<link rel="stylesheet" href="<!--{$url_prefix}-->css/bootstrap.css" />
<link rel="stylesheet" href="<!--{$url_prefix}-->css/cikonss.css">
<link rel="stylesheet" href="<!--{$url_prefix}-->css/consume.css" />
<link rel="stylesheet" href="<!--{$url_prefix}-->css/bootstrap-responsive.css" />
<!-- 加入后变为响应式布局，去掉变为固定宽度布局 -->
<script src="<!--{$url_prefix}-->js/jquery.js"></script>
<script src="<!--{$url_prefix}-->js/bootstrap.js"></script>
<!--[if lt IE 9]>
  <script src="<!--{$url_prefix}-->js/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="main">
	<div class="container clearfix">

		<!--{if $commodityList}-->
		<!--{foreach from=$commodityList item=value name=alt}-->
		<!--{if $smarty.foreach.alt.index%2==0}-->
			<div class="media">
		<!--{else}-->
			<div class="media alphabg">
		<!--{/if}-->
            <a class="pull-left"  href="<!--{$url}-->/home/mallcontent/1/<!--{$value.id_commodity}-->/<!--{$value.id_mall}-->"><img src="<!--{$value.path}-->" />
            <!--{if $value.recommend == 1}--> <img src="<!--{$url_prefix}-->img/hot.png"
                class="hot"> <!--{/if}--></a>
            <div class="media-body">
                <h4>
                    <a href="<!--{$url}-->/home/mallcontent/1/<!--{$value.id_commodity}-->/<!--{$value.id_mall}-->">
                        <!--{$value.name|truncate_utf8:10}-->
                    </a>
                </h4>
                <p class="jifenxinx">
                    <em>积分:<b>
                            <!--{$value.integral}-->
                    </b></em><i>数量:<b>
                            <!--{if $value.quantity > 0}-->充足<!--{else}-->缺货<!--{/if}-->
                    </b></i><a href="<!--{$url}-->/home/mallcontent/1/<!--{$value.id_commodity}-->/<!--{$value.id_mall}-->#replys"><span class="icon icon-small"><span
                            class="icon-comment-text"></span></span><b>
                            <!--{$value.count}-->
                    </b></a>
                </p>
                <small>
                    <!--{$value.descript|truncate_utf8:12}-->
                </small>
            </div>
			</div>
			<!--{/foreach}-->
			<!--{else}-->
			<div class="media alphabg"><div class="error_pop"></div></div>
			<!--{/if}-->
			<input type="hidden" name="cpage" id="cpage" value="<!--{$cpage}-->" />
			
			<script type="text/javascript">
			var flag = 0;
				$(window).bind(
                "scroll",
                function() {

                    if ($(document).height() - $(window).height()
                            - $(document).scrollTop() < 10 && flag == 0) {
                        flag = 1;
                        get_page_data();
                    }
                });
				function get_page_data() {
					var page = parseInt($("#cpage").val()) + 1;
					if($('.error_pop').length == 0){
						$.ajax({
							url : '<!--{$url}-->/home/consume/' + page,
							type : "get",
							success : function(data) {
								result = $(data).find(".media");
								nexpage = $(data).find("#cpage").val();
								if (nexpage) {
									$("#cpage").val(nexpage);
								}
								if (result.get(0) != undefined) {
									//if(!result.find('.error_pop')){
										$(".container").append(result);
										flag = 0;
										
									//}
								}
							}
						});
					}
				}
			</script>
		</div>
		<footer>powered by <a href="http://www.it008.com" target="_blank">赏金猎人</a></footer>
</div>
</body>
</html>
